package com.shenghui.enterprise.base.entity;

import java.util.List;

public class PageModel<T> {
    /**
     * 当前页
     */
    private int pageNum;
    /**
     * 每页的数量
     */
    private int pageSize;
    /**
     * 总记录数
     */
    protected long total;
    /**
     * 结果集
     */
    protected List<T> list;
    /**
     * 是否有上一页
     */
    private boolean top;
    /**
     * 是有有下一页
     */
    private boolean next;


    public PageModel(long total, List<T> list,int pageNum, int pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
        this.list = list;
    }
    public PageModel(long total, List<T> list,int pageNum) {
        this.pageNum = pageNum;
        this.total = total;
        this.list = list;
    }
    public PageModel(long total, List<T> list) {
        this.pageNum = pageNum;
        this.total = total;
        this.list = list;
    }

    public PageModel(long total, List<T> list, boolean next) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
        this.list = list;
        this.next = next;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public boolean isTop() {
        return top;
    }

    public void setTop(boolean top) {
        this.top = top;
    }

    public boolean isNext() {
        return next;
    }

    public void setNext(boolean next) {
        this.next = next;
    }
}
